﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cocbook_DTO
{
    public class CustomerView
    {

        public int CustomerID { get; set; }
        public int ID { get; set; }
        public string Name { get; set; }
        public string Birthday { get; set; }
        public string Address { get; set; }
        public string Email { get; set; }
        public string Phone { get; set; }
        public string Tel { get; set; }
        public int Points { get; set; }

        public CustomerView(Customer c)
        {
            CustomerID = c.CustomerID;
            ID = c.CMND;
            Name = c.CName;
            if (c.Birthday == DateTime.Parse("1/1/1800"))
            {
                Birthday = "N/A";
            }
            else
            {
                Birthday = c.Birthday.ToShortDateString();
            }

            if (c.Email == "" || c.Email == null)
            {
                Email = "N/A";
            }
            else
            {
                Email = c.Email;
            }
            Address = c.CAddress;
            if (c.Phone == ""|| c.Phone == null)
            {
                Phone = "N/A";
            }
            else
            {
                Phone = c.Phone;
            }
            if (c.Tel == ""||c.Tel ==null)
            {
                Tel = "N/A";
            }
            else
            {
                Tel = c.Tel;
            }
            Points = c.Points;


        }
    }
}
